import pickle
from io import BytesIO

a=[1, 2, 3, 4, 5, 6, 8, '111', '222', '333']

# 创建一个内存中的二进制流对象 BytesIO
pkl_stream = BytesIO()
pickle.dump(a, pkl_stream)

# 指针重置到起始位置
pkl_stream.seek(0)
b = pickle.load(pkl_stream)
print(b)
